package com.yehun.dao.impl;

import com.yehun.dao.RoleDao;
import com.yehun.entity.Role;
import com.yehun.mapper.RoleMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class RoleDaoImpl implements RoleDao {

    @Resource
    private RoleMapper roleMapper;

    @Override
    public List<Role> listAll() {
        return roleMapper.listAll();
    }

    @Override
    public Role get(int id) {
        return roleMapper.get(id);
    }

    @Override
    public int save(Role role) {
        return roleMapper.save(role);
    }

    @Override
    public int update(Role role) {
        return roleMapper.update(role);
    }

    @Override
    public int updateUserNumber(int id) {
        return roleMapper.updateUserNumber(id);
    }

    @Override
    public int updatePermission(int id, long permission) {
        return roleMapper.updatePermission(id, permission);
    }

    @Override
    public int remove(Integer[] idArray) {
        return roleMapper.remove(idArray);
    }
}
